#include "epollserver.hpp"
#include <memory>
using namespace epoll_ns;
using namespace std;
static void Usage(std::string proc)
{
    std::cerr << "Usage:\n\t" << proc << " port\r\n\r\n";
}
std::string echo(const std::string &message)
{
    return "I am epollserver, " + message;
}
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    unique_ptr<EpollServer> epollsvr(new EpollServer(echo, atoi(argv[1])));
    epollsvr->initServer();
    epollsvr->start();
    return 0;
}